#ifndef CSCENE_H
#define CSCENE_H

#include <QGraphicsScene>
#include <QMutex>

#include "OpenCV.h"
#include "artoolkitapi.h"
#include "lib3ds.h"
#include "coldet.h"
#include "modeltodraw.h"


class QPixmap;


class CScene : public QGraphicsScene
{
        Q_OBJECT

public:
        CScene(QObject *parent = 0);
        ~CScene();

public:
        bool StartCapture(int width, int height);
        bool StopCapture();
        void ChangeChildValues(double l, double r);

private:
        void drawBackground(QPainter *painter, const QRectF &rect);
        void drawForeground(QPainter *painter, const QRectF &rect);
        void DrawOtherThings(object3ds *todraw, float modelScale, float readyYet);
        void checkCollisions();
        void copyArrayd(double *source, float *destination, int howmany);
        void copyArray(double *source, double *destination, int howmany);
        void getDifference(double *trans, double *eeeek);
        void initializeBricks();


        QTimer *countup;

private:
        QMutex			m_MutexPaint;
        ARToolkitAPI            *m_NyART;
        COpenCV			m_OpenCV;

private slots:
        void timeOut();
        void startStop(int);
};

#endif // CSCENE_H
